format date in php

31

format date in php -

$myDateTime = DateTime::createFromFormat('Y-m-d', $dateString);
$newDateString = $myDateTime->format('d-m-Y');

Comments

Submit
0 Comments